<table width="100%" border="0">
  <tr>
    <td>siteid</td>
    <td><input id="siteid" type="text" value="sis" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>sitename</td>
    <td><input id="sitename" type="text" value="色中色" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>domain</td>
    <td><input id="domain" type="text" value="www.sis001.com" style="width:400px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>urlp</td>
    <td><input id="urlp" type="text" value="http://DOMAIN/forum/forum-FORUMCODE-PAGEINDEX.html" style="width:800px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>trp</td>
    <td><input id="trp" type="text" value="form tr" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>titlep</td>
    <td><input id="titlep" type="text" value="th a" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>urlkeyword</td>
    <td><input id="urlkeyword" type="text" value="thread" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>contentp</td>
    <td><input id="contentp" type="text" value="td.postcontent" style="width:400px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>needproxy</td>
    <td><input id="needproxy" type="text" value="true" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>forumid</td>
    <td><input id="forumid" type="text" value="av53" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>forumcode</td>
    <td><input id="forumcode" type="text" value="53" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>forumname</td>
    <td><input id="forumname" type="text" value="三级写真" style="width:100px"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td><a id="createforumbtn" class="btn btn-info">创建</a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

<script language="javascript">
$(function(){
	
	$("#createforumbtn").click(function(){
		var site = {};
		site.id = $("#siteid").val();
		site.name = $("#sitename").val();
		site.domain = $("#domain").val();
		site.urlp = $("#urlp").val();
		site.trp = $("#trp").val();
		site.titlep = $("#titlep").val();
		site.urlkeyword = $("#urlkeyword").val();
		site.contentp = $("#contentp").val();
		site.needproxy = $("#needproxy").val();
		
		var forum = {};
		forum.site = site;
		forum.id = $("#forumid").val();
		forum.code = $("#forumcode").val();
		forum.name = $("#forumname").val();
		
		
		console.log("site json:");
		console.log(site);		
		console.log("forum json:");
		console.log(forum);	
		
		
		var myDataRef = new Firebase('https://luntankong.firebaseIO.com/forums/');
		var child = myDataRef.child(forum.id);
		child.set(forum);
		alert("添加"+forum.id+"完毕");
	});	
	
	
	
})

</script>